home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / doc / AppInit.3 < prev    next >
Text File  |  1993-06-07  |  3KB  |  69 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/AppInit.3,v 1.2 93/06/07 15:11:46 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tcl_AppInit tclc 7.0
  25. .BS
  26. .SH NAME
  27. Tcl_AppInit \- Perform application-specific initialization
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tcl.h>\fR
  31. .sp
  32. \fBTcl_AppInit\fR(\fIinterp\fR)
  33. .SH ARGUMENTS
  34. .AS Tcl_Interp *interp
  35. .AP Tcl_Interp *interp in
  36. Interpreter for the application.
  37. .BE
  38.  
  39. .SH DESCRIPTION
  40. .PP
  41. \fBTcl_AppInit\fR is a procedure that is invoked by the main programs
  42. for Tcl applications such as \fBtclsh\fR and \fBwish\fR.
  43. Its purpose is to allow new Tcl applications to be created without
  44. modifying existing main programs such as those for \fBtclsh\fR
  45. and \fBwish\fR.
  46. To create a new application simply write a new version of
  47. \fBTcl_AppInit\fR to replace the default version provided by Tcl,
  48. then link your new \fBTcl_AppInit\fR with the Tcl library, which
  49. contains the main program from \fBtclsh\fR (be sure to specify the
  50. switch ``\fB\-u _main\fR'' to the linker to force it to use the
  51. version of \fBmain\fR from the Tcl library).
  52. .PP
  53. \fBTcl_AppInit\fR is invoked after other initialization in
  54. \fBmain\fR and before entering the main loop to process commands.
  55. Here are some examples of things that \fBTcl_AppInit\fR might do:
  56. .IP [1]
  57. Call initialization procedures for various packages used by
  58. the application.
  59. Each initialization procedure adds new commands to \fIinterp\fR
  60. for its package and performs other package-specific initialization.
  61. .IP [2]
  62. Process command-line arguments, which can be accessed from the
  63. Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
  64. .IP [3]
  65. Invoke a startup script to initialize the application.
  66.  
  67. .SH KEYWORDS
  68. application, argument, command, initialization, interpreter
  69.